/**
@description base文件

@copyright    Copyright 2021 高灯科技
@version      1.0.0
@link         https://www.goldentec.com
@author       venki.chen <venki.chen@goldentec.com>
@datetime     2021/11/13 16:20
*/

package base

import "fmt"

const (
	// BEIJING_CODE 地区编码枚举 - 连续
	BEIJING_CODE  = iota // 0
	SHANGHAI_CODE        // 1
	TIANJING_CODE        // 2
)

const (
	a, b = iota + 1, iota + 2 // iota = 0,a = iota + 1, b = iota + 2, a = 1, b = 2
	c, d                      // iota = 1,c = iota + 1, d = iota + 2, c = 2, d = 3
	e, f                      // iota = 2,e = iota + 1, f = iota + 2, e = 3, f = 4

	g, h = 2 * iota, 3 * iota // iota = 3,a = 2 * iota, b = 3 * iota, g = 6, h = 9
	i, j                      // iota = 4,i = 2 * iota, j = 3 * iota, i = 8, j = 12
)

func init() {
	fmt.Println("base模块初始化成功……")
}

func Access() {
	ConstReview()
	// IntReview()
}

func ConstReview() {
	// fmt.Println(BEIJING_CODE)
	// fmt.Println(SHANGHAI_CODE)
	// fmt.Println(TIANJING_CODE)
	fmt.Println("a=", a, "b=", b)
	fmt.Println("c=", c, "d=", d)
	fmt.Println("e=", e, "f=", f)
	fmt.Println("g=", g, "h=", h)
	fmt.Println("i=", i, "j=", j)

}

func IntReview() {
	// 方法一:默认值0
	var a int
	fmt.Println(a)
	fmt.Println()

	// 方法二
	var b int = 10
	fmt.Println(b)
	fmt.Println()

	// 方法三 类型推到
	var c = 100
	fmt.Println(c)
	fmt.Println()

	// 方法四 类型推到
	d := 100
	fmt.Println(d)
	fmt.Println()
	fmt.Printf("%T\n", d)

	fmt.Println("声明多变量")
	// 方法一
	var aa, bb, cc int = 10, 100, 100
	fmt.Printf("aa=%v,bb=%v,cc=%v\n", aa, bb, cc)

	// 方法二
	var dd, ee = 100, "venki.chen"
	fmt.Printf("dd=%v,ee=%v\n", dd, ee)
}
